#include<iostream>
using namespace std;
typedef long long LL;
int a, b, n;
int main()
{
	int t;
	cin >> t;
	while (t--) {
		cin >> a >> b >> n;
		if (!n) {
			cout << 0 << endl;
			continue;
		}
		LL ans = 0;
		if (a <= b)ans = b * n * 1ll;
		else {
			if (n & 1)ans = 1ll * (a + b) * (n - 1) / 2, ans += b;
			else ans = 1ll * (a + b) * (n - 2) / 2, ans += 2 * b;
		}
		cout << ans << endl;
	}
	return 0;
}